package com.ssy.lingxi.member.merchant.api.feign.paas;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.MenuButtonDeleteVO;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.MenuButtonVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;

/**
 * 菜单管理接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-01
 */
@FeignClient(name = "merchant-member-service")
@RequestMapping("/paas/menu")
public interface MenuControllerFeign {
    /**
     * 新增菜单
     * @param addVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    Wrapper<Void> addMenu(@RequestBody @Valid MenuButtonVO addVO);

    /**
     * 修改菜单
     * @param updateVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    Wrapper<Void> updateMenu(@RequestBody @Valid MenuButtonVO updateVO);


    /**
     * 删除菜单及下属菜单，以及按钮
     * @param menuVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    Wrapper<?> deleteMenu(@RequestBody @Valid MenuButtonDeleteVO menuVO);
}
